package com.neuedu.mapper;

import com.neuedu.po.User;
import org.apache.ibatis.annotations.*;


import java.util.List;

@Mapper
public interface UserMapper {

    //根据uname 和 homecall做模糊匹配，在映射文件里面写sql语句
    public List<User> selectAll(User u);

    @Select ("select * from fa_user where id=#{id}")
    public User selectById(User u);
    @Insert("insert into fa_user(uname,pass,account,sal,homecall,age,power) values (#{uname},#{pass},#{account},#{sal},#{homecall},#{age},#{power})")
    public int add(User u);
    @Update("update fa_user set uname=#{uname},pass=#{pass},account=#{account},sal=#{sal},homecall=#{homecall},age=#{age},power=#{power} where id=#{id}")
    public int update(User u);
    @Delete("delete from fa_user where id=#{id}")
    public int delete(User u);

    @Select("select * from fa_user where uname=#{uname} and pass =#{pass}")
    public User selectByUnameByPass(User u);

}
